package com.xmmj.baselibrary.base.activity.mvvm

import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext

open class BaseModel : IModel {

    suspend fun <T : Any> request(call: suspend () -> T): T {
        return withContext(Dispatchers.IO) {
            call.invoke()
        }
    }

    override fun onCleared() {

    }
}